package com.demo.controller;

import com.alibaba.fastjson.JSON;
import com.demo.mapper.test.UserMapper;
import com.demo.model.test.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {

    @Autowired
    private UserMapper userMapper;


    @GetMapping("/getUser")
    public String  getUser(Integer id){
        User user = userMapper.selectById(id);
        return JSON.toJSONString(user);

    }
}

